package com.acme.domain.bank;

import java.util.ArrayList;

import com.acme.domain.account.Account;
import com.acme.domain.client.Client;
import com.acme.exceptions.ClientExistsException;

public class BankService {
	public static void addClient(Bank bank, Client client) throws ClientExistsException {
		ArrayList<Client> bankClients = bank.getClients();
		if(bankClients.contains(client)) {
			throw new ClientExistsException(client.getName(), bank.getID());
		}
		bank.addClient(client);
	}
}
